/**
 * FileName:SellerServiceImpl
 * Author:WL
 * CreateTime:2021/7/15 17:08
 * UpdateTime:
 * Description:<一句话描述>
 * Version:1.0.0
 */
package com.esc.service.impl;

import com.esc.mapper.SellerMapper;
import com.esc.model.Seller;
import com.esc.service.SellerService;
import com.esc.util.PageResult;
import com.esc.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <一句话描述>
 * Author:WL
 * CreateTime:2021/7/15 17:08
 * UpdateTime:
 * Version:1.0.0
 */
@Service
public class SellerServiceImpl implements SellerService {
    @Autowired
    private SellerMapper sellerMapper;

    @Override
    public PageResult querySellerList(PageUtil<Seller> pageUtil, Integer queryId) {
        PageResult page = new PageResult();
        int total = sellerMapper.queryCount(queryId);
        page.setTotal(total);
        List<Seller> list =sellerMapper.querySellerList(pageUtil.getStartIndex(),pageUtil.getRows(),queryId);
        page.setRows(list);
        return page;
    }

    @Override
    public void updateSellerStauts(Integer sellerid,Integer status) {
        sellerMapper.updateSellerStauts(sellerid,status);
    }

    @Override
    public Seller querySellerById(Integer sellerid) {
        return sellerMapper.querySellerById(sellerid);
    }

    @Override
    public void updateSeller(Seller seller) {
        sellerMapper.updateSeller(seller);
    }
}
